package com.example.demo.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.demo.entity.FileInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface FileInfoMapper extends BaseMapper<FileInfo> {

    // 查询所有文件信息
    @Select("SELECT id, file_name, file_path FROM file_info")
    List<FileInfo> selectAllFiles();

    // 根据ID查询文件信息
    @Select("SELECT id, file_name, file_path   FROM file_info WHERE id = #{id}")
    FileInfo selectFileById(Long id);


    // 添加对应XML文件中的方法
    List<FileInfo> selectAllFilesXml();

    FileInfo selectFileByIdXml(Long id);

    int updateFileByIdXml(FileInfo fileInfo);
}
